package com.bwie.controller;

import com.bwie.pojo.TbBrand;
import com.bwie.service.TbBrandService;
import com.bwie.utils.R;
import com.bwie.vo.BrandVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @description : TODO
 * @Author QiHainan
 * @Create 2025/7/19 8:44
 * @Version 1.0
 */
@RestController
@RequestMapping("/prod/brand")
public class BrandController {
    @Autowired
    TbBrandService tbBrandService;

    /**
     * 获取品牌列表
     * @param brandVo
     * @return
     */
    @PostMapping("/getBrandList")
    public R getBrandList(@RequestBody BrandVo brandVo){
        return tbBrandService.getBrandList(brandVo);
    }

    /**
     * 添加品牌
     * @param tbBrand
     * @return
     */
    @PostMapping("/addBrand")
    public R addBrand(@RequestBody TbBrand tbBrand){
        return tbBrandService.addBrand(tbBrand);
    }

    /**
     * 更改品牌状态
     * @param tbBrand
     * @return
     */
    @PostMapping("/changeBrandStatus")
    public R changeBrandStatus(@RequestBody TbBrand tbBrand){
        return tbBrandService.changeBrandStatus(tbBrand);
    }
}
